var Rocket = function (x, y, width, height, direction, damage, imageOptions, animationOptions) {
    Rocket.base.call(this, x, y, width, height, imageOptions);
    this.damage = damage;
    this.speed = 500;
    this.direction = direction;
    this.time = 0;
    this.frameTime = imageOptions.frameTime;
    this.frameCount = imageOptions.frameCount;
    this.render = function (drawEngine, dt) {
        var frameIndex = Math.round(this.time / this.frameTime);
        if (frameIndex >= this.frameCount) {
            this.time = 0;
            frameIndex = 0;
        }
        else {
            this.time = this.time + dt * 1000;
        }
        if (this.direction == 0) {
            drawEngine.render(this.image, frameIndex * this.image.width, 0, this.image.width, this.image.height, this.x, this.y, this.width, this.height);
        }
        else if (this.direction == 1) {
            drawEngine.render(this.image, frameIndex * this.image.height, this.image.height, this.image.height, this.image.width, this.x, this.y, this.height, this.width);
        }
        else if (this.direction == 2) {
            drawEngine.render(this.image, frameIndex * this.image.width, this.image.width + this.image.height, this.image.width, this.image.height, this.x, this.y, this.width, this.height);
        }
        else if (this.direction == 3) {
            drawEngine.render(this.image, frameIndex * this.image.height, this.image.width + 2 * this.image.height, this.image.height, this.image.width, this.x, this.y, this.height, this.width);
        }
    };
};

epam.tankBattles.common.extend(Rocket, BaseGameObject);
